<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>微信会员管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function hideWin(recommendCode,memberId){
			
			$.get("${ctx}/wechat/wechatMember/updateRecommendMember?parentCode="+recommendCode+"&memberId="+memberId, function(result){
			});
			alert("设置成功！");
			window.parent.window.jBox.close();
		}
	</script>
</head>
<body style="width:800;">
	
	<form:form id="searchForm" modelAttribute="wechatMember" action="${ctx}/wechat/wechatMember/recommendMemberList?isFind=yes&memberId=${memberId}" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>姓名 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		<label>手机 ：</label><form:input path="mobile" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<label>请根据姓名或手机号查找设为‘上级推荐人’的会员</label>
	</form:form>
	<tags:message content="${message}"/>
	<c:if test="${isFind eq 'yes' }">
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead>
			<tr>
				<!-- <th>ID</th> -->
				<th>姓名</th>
				<th>昵称</th>
				<th>会员卡号</th>
				<th>手机号</th>
				<th>推荐码</th>
				<!-- <th>操作</th> -->
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="wechatMember">
			<tr onclick="javascript:hideWin('${wechatMember.recommendCode}',${memberId});" style="cursor: pointer;">
				<%-- <td>${wechatMember.id}</td> --%>
				<td><span title="${wechatMember.name }" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 80px;display: inline-block;">${wechatMember.name }</span></td>
				<td><span title="${wechatMember.nickname }" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 80px;display: inline-block;">${wechatMember.nickname }</span></td>
				<td>${wechatMember.number}</td>
				<td>${wechatMember.mobile}</td>
				<td>${wechatMember.recommendCode}</td>
				<%-- <td>
					<a href="javascript:hideWin('${wechatMember.recommendCode}',${memberId});"  class="btn btn-success" >设置为推荐人</a>
					${ctx}/wechat/wechatMember/updateRecommendMember?parentCode=${wechatMember.recommendCode}&memberId=${memberId}
				</td> --%>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	</c:if>
	
	<div class="pagination">${page}</div>
</body>
</html>
